package abs.dao;

import abs.domain.GrupoProveedores;

import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import org.skyway.spring.util.dao.AbstractJpaDao;

import org.springframework.dao.DataAccessException;

import org.springframework.stereotype.Repository;

import org.springframework.transaction.annotation.Transactional;

/**
 * DAO to manage GrupoProveedores entities.
 * 
 */
@Repository("GrupoProveedoresDAO")
@Transactional
public class GrupoProveedoresDAOImpl extends AbstractJpaDao<GrupoProveedores>
		implements GrupoProveedoresDAO {

	/**
	 * Set of entity classes managed by this DAO.  Typically a DAO manages a single entity.
	 *
	 */
	private final static Set<Class<?>> dataTypes = new HashSet<Class<?>>(Arrays.asList(new Class<?>[] { GrupoProveedores.class }));

	/**
	 * EntityManager injected by Spring for persistence unit absV2
	 *
	 */
	@PersistenceContext(unitName = "absV2")
	private EntityManager entityManager;

	/**
	 * Instantiates a new GrupoProveedoresDAOImpl
	 *
	 */
	public GrupoProveedoresDAOImpl() {
		super();
	}

	/**
	 * Get the entity manager that manages persistence unit 
	 *
	 */
	@Override
	public EntityManager getEntityManager() {
		return entityManager;
	}

	/**
	 * Returns the set of entity classes managed by this DAO.
	 *
	 */
	@Override
	public Set<Class<?>> getTypes() {
		return dataTypes;
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100loadContaining
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100loadContaining(String grppr100load) throws DataAccessException {

		return findGrupoProveedoresByGrppr100loadContaining(grppr100load, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100loadContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100loadContaining(String grppr100load, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100loadContaining", startResult, maxRows, grppr100load);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100tipo
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100tipo(String grppr100tipo) throws DataAccessException {

		return findGrupoProveedoresByGrppr100tipo(grppr100tipo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100tipo
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100tipo(String grppr100tipo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100tipo", startResult, maxRows, grppr100tipo);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100nociaContaining
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100nociaContaining(String grppr100nocia) throws DataAccessException {

		return findGrupoProveedoresByGrppr100nociaContaining(grppr100nocia, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100nociaContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100nociaContaining(String grppr100nocia, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100nociaContaining", startResult, maxRows, grppr100nocia);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100tipoContaining
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100tipoContaining(String grppr100tipo) throws DataAccessException {

		return findGrupoProveedoresByGrppr100tipoContaining(grppr100tipo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100tipoContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100tipoContaining(String grppr100tipo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100tipoContaining", startResult, maxRows, grppr100tipo);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100feadAfter
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100feadAfter(java.util.Calendar grppr100fead) throws DataAccessException {

		return findGrupoProveedoresByGrppr100feadAfter(grppr100fead, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100feadAfter
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100feadAfter(java.util.Calendar grppr100fead, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100feadAfter", startResult, maxRows, grppr100fead);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100lomoContaining
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100lomoContaining(String grppr100lomo) throws DataAccessException {

		return findGrupoProveedoresByGrppr100lomoContaining(grppr100lomo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100lomoContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100lomoContaining(String grppr100lomo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100lomoContaining", startResult, maxRows, grppr100lomo);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findAllGrupoProveedoress
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findAllGrupoProveedoress() throws DataAccessException {

		return findAllGrupoProveedoress(-1, -1);
	}

	/**
	 * JPQL Query - findAllGrupoProveedoress
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findAllGrupoProveedoress(int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findAllGrupoProveedoress", startResult, maxRows);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100cdgo
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100cdgo(String grppr100cdgo) throws DataAccessException {

		return findGrupoProveedoresByGrppr100cdgo(grppr100cdgo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100cdgo
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100cdgo(String grppr100cdgo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100cdgo", startResult, maxRows, grppr100cdgo);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100lomo
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100lomo(String grppr100lomo) throws DataAccessException {

		return findGrupoProveedoresByGrppr100lomo(grppr100lomo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100lomo
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100lomo(String grppr100lomo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100lomo", startResult, maxRows, grppr100lomo);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100feadBefore
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100feadBefore(java.util.Calendar grppr100fead) throws DataAccessException {

		return findGrupoProveedoresByGrppr100feadBefore(grppr100fead, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100feadBefore
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100feadBefore(java.util.Calendar grppr100fead, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100feadBefore", startResult, maxRows, grppr100fead);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100femoBefore
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100femoBefore(java.util.Calendar grppr100femo) throws DataAccessException {

		return findGrupoProveedoresByGrppr100femoBefore(grppr100femo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100femoBefore
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100femoBefore(java.util.Calendar grppr100femo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100femoBefore", startResult, maxRows, grppr100femo);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100nocia
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100nocia(String grppr100nocia) throws DataAccessException {

		return findGrupoProveedoresByGrppr100nocia(grppr100nocia, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100nocia
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100nocia(String grppr100nocia, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100nocia", startResult, maxRows, grppr100nocia);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100nameContaining
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100nameContaining(String grppr100name) throws DataAccessException {

		return findGrupoProveedoresByGrppr100nameContaining(grppr100name, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100nameContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100nameContaining(String grppr100name, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100nameContaining", startResult, maxRows, grppr100name);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100clas
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100clas(String grppr100clas) throws DataAccessException {

		return findGrupoProveedoresByGrppr100clas(grppr100clas, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100clas
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100clas(String grppr100clas, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100clas", startResult, maxRows, grppr100clas);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100fead
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100fead(java.util.Calendar grppr100fead) throws DataAccessException {

		return findGrupoProveedoresByGrppr100fead(grppr100fead, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100fead
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100fead(java.util.Calendar grppr100fead, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100fead", startResult, maxRows, grppr100fead);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100femo
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100femo(java.util.Calendar grppr100femo) throws DataAccessException {

		return findGrupoProveedoresByGrppr100femo(grppr100femo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100femo
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100femo(java.util.Calendar grppr100femo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100femo", startResult, maxRows, grppr100femo);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByPrimaryKey
	 *
	 */
	@Transactional
	public GrupoProveedores findGrupoProveedoresByPrimaryKey(String grppr100cdgo) throws DataAccessException {

		return findGrupoProveedoresByPrimaryKey(grppr100cdgo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByPrimaryKey
	 *
	 */

	@Transactional
	public GrupoProveedores findGrupoProveedoresByPrimaryKey(String grppr100cdgo, int startResult, int maxRows) throws DataAccessException {
		try {
			Query query = createNamedQuery("findGrupoProveedoresByPrimaryKey", startResult, maxRows, grppr100cdgo);
			return (abs.domain.GrupoProveedores) query.getSingleResult();
		} catch (NoResultException nre) {
			return null;
		}
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100cdgoContaining
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100cdgoContaining(String grppr100cdgo) throws DataAccessException {

		return findGrupoProveedoresByGrppr100cdgoContaining(grppr100cdgo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100cdgoContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100cdgoContaining(String grppr100cdgo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100cdgoContaining", startResult, maxRows, grppr100cdgo);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByPrimaryKey
	 *
	 */
	@Override
	@Transactional
	public GrupoProveedores findGrupoProveedoresByPrimaryKey(String grppr100nocia, String grppr100cdgo) throws DataAccessException {

		return findGrupoProveedoresByPrimaryKey(grppr100nocia, grppr100cdgo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByPrimaryKey
	 *
	 */

	@Override
	@Transactional
	public GrupoProveedores findGrupoProveedoresByPrimaryKey(String grppr100nocia, String grppr100cdgo, int startResult, int maxRows) throws DataAccessException {
		try {
			Query query = createNamedQuery("findGrupoProveedoresByPrimaryKey", startResult, maxRows, grppr100nocia, grppr100cdgo);
			return (abs.domain.GrupoProveedores) query.getSingleResult();
		} catch (NoResultException nre) {
			return null;
		}
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100esta
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100esta(String grppr100esta) throws DataAccessException {

		return findGrupoProveedoresByGrppr100esta(grppr100esta, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100esta
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100esta(String grppr100esta, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100esta", startResult, maxRows, grppr100esta);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100femoAfter
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100femoAfter(java.util.Calendar grppr100femo) throws DataAccessException {

		return findGrupoProveedoresByGrppr100femoAfter(grppr100femo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100femoAfter
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100femoAfter(java.util.Calendar grppr100femo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100femoAfter", startResult, maxRows, grppr100femo);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100load
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100load(String grppr100load) throws DataAccessException {

		return findGrupoProveedoresByGrppr100load(grppr100load, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100load
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100load(String grppr100load, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100load", startResult, maxRows, grppr100load);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100estaContaining
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100estaContaining(String grppr100esta) throws DataAccessException {

		return findGrupoProveedoresByGrppr100estaContaining(grppr100esta, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100estaContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100estaContaining(String grppr100esta, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100estaContaining", startResult, maxRows, grppr100esta);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100clasContaining
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100clasContaining(String grppr100clas) throws DataAccessException {

		return findGrupoProveedoresByGrppr100clasContaining(grppr100clas, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100clasContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100clasContaining(String grppr100clas, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100clasContaining", startResult, maxRows, grppr100clas);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100name
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100name(String grppr100name) throws DataAccessException {

		return findGrupoProveedoresByGrppr100name(grppr100name, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoProveedoresByGrppr100name
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoProveedores> findGrupoProveedoresByGrppr100name(String grppr100name, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoProveedoresByGrppr100name", startResult, maxRows, grppr100name);
		return new LinkedHashSet<GrupoProveedores>(query.getResultList());
	}

	/**
	 * Used to determine whether or not to merge the entity or persist the entity when calling Store
	 * @see store
	 * 
	 *
	 */
	@Override
	public boolean canBeMerged(GrupoProveedores entity) {
		return true;
	}
}
